<?php

namespace App\Services;

use App\Models\PreDzlabQwenVersion;
use Illuminate\Support\Arr;
use Slowlyo\OwlAdmin\Services\AdminService;

/**
 * 个人套餐
 *
 * @method PreDzlabQwenVersion getModel()
 * @method PreDzlabQwenVersion|\Illuminate\Database\Query\Builder query()
 */
class PreDzlabQwenVersionService extends AdminService
{
	protected string $modelName = PreDzlabQwenVersion::class;

	public function sortable($query)
	{
		if (request()->orderBy && request()->orderDir) {
			$query->orderBy(request()->orderBy, request()->orderDir ?? 'asc');
		} else {
			$query->orderBy('displayorder');
		}
	}

	public function addRelations($query, string $scene = 'list')
	{
		if($scene == 'list')
		{
			$query->with(['model']);
		}

	}
}
